﻿<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>My Baby</title>
	<!-- 引入样式 -->
	<link href="css/default.css" type="text/css" rel="stylesheet">
</head>
<body>
	<div id="mainDiv">
		<div id="content">
			<!-- 自动爱心部分 -->
			<div id="loveHeart">
				<canvas id="garden"></canvas>
				<div id="words">
					<div id="messages">
						宝贝，这是你来到这个世界的时间。<br/>
						<div id="startTime">2022-09-02 23:02:00 ~ 至今</div>
						<div id="elapseClock"></div>
					</div>
					<div id="loveu">
						爱你直到永永远远。<br/>
						<div class="signature">- Father</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<!-- jquery引入 -->
	<script type="text/javascript" src="js/jquery.js"></script>

	<!-- 自动爱心js引入 -->
	<script type="text/javascript" src="js/garden.js"></script>
	<script type="text/javascript" src="js/functions.js"></script>

	<script type="text/javascript">
		var offsetX = $("#loveHeart").width() / 2;
		var offsetY = $("#loveHeart").height() / 2 - 55;
		var together = new Date();//今天
		together.setFullYear(2022, 8, 2);//2022-09-02
		together.setHours(23);//小时
		together.setMinutes(2);//分钟
		together.setSeconds(0);//秒
		together.setMilliseconds(0);

		if (!document.createElement('canvas').getContext) {
			var msg = document.createElement("div");
			msg.id = "errorMsg";
			msg.innerHTML = "Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+"; 
			document.body.appendChild(msg);
			$("#code").css("display", "none")
			$("#copyright").css("position", "absolute");
			$("#copyright").css("bottom", "10px");
			document.execCommand("stop");	
		} else {
			setTimeout(function () {
				startHeartAnimation();
			}, 0);//定时器 50000  1000=1s

			timeElapse(together);
			setInterval(function () {
				timeElapse(together);
			}, 0);//延时时间 50000 1000=1s

			adjustCodePosition();
			$("#code").typewriter();
		}
	</script>
</body>
</html>